<?php

namespace App\Params\Common;

use App\Params\BaseParam;

class AlbumEditParams extends BaseParam
{
    public $mid;

    public $id;

    public $name;

    public $cover;

    public $desc;


    public function rules()
    {
        return [
            'mid' => 'required|string',
            'id' => 'integer',
            'name' => 'required|string|max:30',
            'cover' => 'required|string|max:200',
            'desc' => 'string|max:200',
        ];
    }

    public function message()
    {
        return [
            "mid.required" => "商户号不能为空",
            "name.required" => "名称不能为空",
            "name.string" => "名称参数错误",
            "name.max" => "名称参数过长",
            "cover.required" => "封面不能为空",
            "cover.string" => "封面异常",
            "cover.max" => "封面字符串过长",
            "desc.max" => "介绍参数过长",
        ];
    }

    public function getId(): int
    {
        return (int)$this->id ?: 0;
    }

    public function getName()
    {
        return $this->name;
    }

    public function getCover()
    {
        return $this->cover;
    }

    public function getDesc()
    {
        return $this->desc;
    }

    public function getMid()
    {
        return $this->mid;
    }
}
